package com.swordliu.facebook.service.impl;

import com.swordliu.facebook.dao.RoleMapper;
import com.swordliu.facebook.dao.base.BaseMapper;
import com.swordliu.facebook.pojo.entity.Role;
import com.swordliu.facebook.service.RoleService;
import com.swordliu.facebook.service.base.BaseServiceSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * RoleServiceImpl
 * Created by SwordLiu on 2017-07-24.
 */
@Service
public class RoleServiceImpl extends BaseServiceSupport<Role> implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public List<Role> getRoles() throws Exception {
        List<Role> list = roleMapper.selectRoles();
        return list;
    }

    @Override
    public Set<String> getRoleKeys(Long id) {
        return roleMapper.selectRoleKeys(id);
    }

    @Override
    protected BaseMapper<Role> getBaseMapper() {
        return roleMapper;
    }
}
